package com.office.shop.by.components;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Calendar;

/**
 * Created by IntelliJ IDEA.
 * User: Олег Семенов
 * Date: 04.07.11
 * Time: 13:51
 * To change this template use File | Settings | File Templates.
 */
public class CFormat {

    public static DecimalFormat DecimalFormat = new DecimalFormat(CConfig.decimalFormat);
    public static DecimalFormatSymbols DecimalFormatSymbols = DecimalFormat.getDecimalFormatSymbols();

    public static String numberFormat(String number)
    {
      DecimalFormatSymbols.setGroupingSeparator(CConfig.setGroupingSeparator);
      DecimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols);
      return  DecimalFormat.format(Double.parseDouble(number));
    }

    public static long dateToMilliSeconds(int day, int month, int year, int hour, int minute)  {
        Calendar c = Calendar.getInstance();
        c.set(year, month, day, hour, minute, 00);
        return c.getTimeInMillis();
   }

}
